package com.itheima.chapter09.io.objectstream;

import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectOutputStream;

//对象序列化流
public class ObjectOutputStreamDemo {
    public static void main(String[] args) throws IOException {
        ObjectOutputStream oos =new ObjectOutputStream(new FileOutputStream("MyIdeaTest\\oos.txt"));
        Student s1= new Student("zhangsan",23);
        Student s2= new Student("lisi",56);
        Student s3= new Student("wangwu",32);
        oos.writeObject(s1);
        oos.writeObject(s2);
        oos.writeObject(s3);
        oos.close();
    }
}
